<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
        xmlns:icecore="http://www.icefaces.org/icefaces/core"
       xmlns:ace="http://www.icefaces.org/icefaces/components"
       xmlns:ice="http://www.icesoft.com/icefaces/component"
       >      
    <h:head>
        <title><h:outputText>Übungsblätter anzeigen</h:outputText></title>
    </h:head>
    <h:body>
        <ui:composition template="WEB-INF/templates/lecture.xhtml">                        
            <ui:define name="content">
                <ice:dataTable value="#{lectureBean.lecture.exerciseSheets}" 
                               var="row">
                    <ice:column>
                        <f:facet name="header">
                            <ice:outputText value="Name" />
                        </f:facet>
                        <ice:outputText> #{row.name} </ice:outputText>
                    </ice:column>
                    <ice:column>
                        <f:facet name="header">
                            <ice:outputText value="Übungsblatt downloaden" />                                                            
                        </f:facet>
                        <ice:outputResource resource="#{showSheetBean.getResource(row.exerciseSheetFile)}"
                                            type="button"/>
                    </ice:column>
                    <ice:column>
                        <f:facet name="header">
                            <ice:outputText value="Musterlösung downloaden" />
                        </f:facet>
                        <ice:outputResource resource="#{showSheetBean.getResource(row.solutionFile)}"
                                            type="button"/>
                    </ice:column>
                    <ice:column>
                        <f:facet name="header"><ice:outputText value="Ausgabetermin" /></f:facet>
                        <ice:outputText value="#{row.dateOfRelease}" />
                    </ice:column>
                    <ice:column>
                        <f:facet name="header"><ice:outputText value="Abgabetermin" /></f:facet>
                        <ice:outputText value="#{row.dateOfReturn}" />
                    </ice:column>
                    <ice:column>
                        <f:facet name="header">
                            <ice:outputText value="Löschen" />                                                            
                        </f:facet>
                        <ice:form>
                            <ice:commandLink value="Löschen"
                                             action="#{lectureBean.lecture.removeSheet(row)}" />
                        </ice:form>
                    </ice:column>
                        
                </ice:dataTable>
            </ui:define>
        </ui:composition>
    </h:body>
</html>